package com.hopes.bizz.line.pipe.vo;

import com.hopes.bizz.line.pipe.entity.LinePipeEntity;
import com.hopes.bizz.line.pipe.entity.LineValveEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Optional;

/**
 * @author yumr
 * @ProjectName bizz
 * @Description 管段VO
 * @time 2024/2/22 13:41
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class LinePipeVO extends LinePipeEntity {

    private static final long serialVersionUID = -1731869223039013972L;

    /**
     * 阀门信息
     */
    private List<LineValveEntity> lineValveList;


    public Integer getValveNum() {
        return Optional.ofNullable(lineValveList).map(List::size).orElse(0);
    }

}
